import request from '@/utils/request'

// 查询接口列表
export function listInterface(query) {
  return request({
    url: '/rms/interface/',
    method: 'get',
    params: query
  })
}

// 查询接口详细
export function getInterface(id) {
  return request({
    url: `/rms/interface/${id}/`,
    method: 'get'
  })
}

// 查询接口详细历史
export function getHistory(id) {
  return request({
    url: `/rms/interface/${id}/history/`,
    method: 'get',
  })
}

// 新增接口
export function addInterface(data) {
  return request({
    url: '/rms/interface/',
    method: 'post',
    data: data
  })
}

// 修改接口
export function updateInterface(data) {
  return request({
    url: `/rms/interface${data.id}/`,
    method: 'put',
    data: data
  })
}

// 删除接口
export function delInterface(id) {
  return request({
    url: `/rms/interface${id}/`,
    method: 'delete'
  })
}